<template>
	<view class="newCar-page" :style="'background-color:' + pageBackgroundColor + ';'">
		<cu-custom bgColor="bg-blue" :isBack="true">
			<block slot="backText"></block>
			<block slot="content">
				<text class="nav-title">新能源车</text>
			</block>
		</cu-custom>
		<addressSearchFixed ref="setAddres" @searchBtn='event_clickSearchBtn' :isShowAddress="false">
		</addressSearchFixed>

		<view style="padding-top: 100rpx;">
			<txl @ev="evFunc" :datas="datas" color="red" :index="true" name="employeeName"></txl>
			<!-- <SortPickerList ref="sortPickerList" @clickData="clickData" ></SortPickerList> -->
			<!-- <t-index-address @select="select"></t-index-address> -->
		</view>
	</view>
	</view>
</template>

<script>
	import SortPickerList from "@/components/International-sortPickerList/index.vue";
	import txl from '@/components/yt-txl/index.vue';
	import citySelect from "@/components/city-select/city-select.vue"
	
	
	
	import cuCustom from "@/components/custom-nav/cu-custom.vue";
	import addressSearchFixed from "@/components/addressSearch/addressSearchFixed.vue";
	export default {
		components: {
			cuCustom,
			addressSearchFixed,
			SortPickerList,
			txl,
			citySelect
		},
		data() {
			return {
				customNavTitleIndex: 1, // 页面标题下标
				pageBackgroundColor: '#FFFFFF', // 页面背景颜色
				sreachContent: '', //寻车列表中搜索框的功能
				datas: [
					{
					"employeeId": "test1",
					"employeeName": "A冰冰",
					"companyId": "1",
					"companyName": "test company",
					"departmentId": "testdeptid",
					"departmentName": "test dept",
					"postId": "testpostid",
					"postName": "testpost",
					list: [{
						id:1,
						num:10,
						name: '奥迪A6新能源',
					},{
						id:2,
						num:6,
						name: '奥迪Q2 e-tron',
					},{
						id:3,
						num:6,
						name: '奥迪Q5 e-tron',
					}]
				},
				{
					"employeeId": "2",
					"employeeName": "埃安",
					list: [{
						id:5,
						num:15,
						name: 'Aion LX',
					}]
				},
				{
					"employeeId": "test1",
					"employeeName": "奔驰",
					list: [{
						name: 123,
					}]
				},
				{
					
					"employeeId": "test1",
					"employeeName": "A冰冰",
					"companyId": "1",
					"companyName": "test company",
					"departmentId": "testdeptid",
					"departmentName": "test dept",
					"postId": "testpostid",
					"postName": "testpost",
					list: [{
						id:1,
						num:10,
						name: '奥迪A6新能源',
					},{
						id:2,
						num:6,
						name: '奥迪Q2 e-tron',
					},{
						id:3,
						num:6,
						name: '奥迪Q5 e-tron',
					}]
				},
				
				
				
				
			]
			}
		},
		// onReady() {
		// 	var that = this
		// 	that.$refs["sortPickerList"].initPage();
		// },
		onShow() {
			try {
				// this.$utils.stopPage(); //禁止页面本身的滑动
				this.$refs.setAddres.setAddres()
			} catch (e) {
				//TODO handle the exception
			}

		},
		onHide() {
			this.$utils.movePage()
		},
		onUnload() {
			this.$utils.movePage()
		},
		methods: {
			 select(data) {
			        console.log(data)
			    },
			evFunc(data) {
				console.log(data)
			},
			clickData(data) {
				console.log(data);
			},

			// 点击——新车
			event_clickNewCarTitle() {
				this.$utils.log("新车")
				this.currentTitle = '新车'
			},
			// 点击——寻车
			event_clickSeachCarTitle() {
				this.$utils.log("寻车")
				this.currentTitle = '寻车'
			},
			// 点击——搜索框搜索按钮
			event_clickSearchBtn(content) {
				this.sreachContent = content
				this.$utils.log("点击搜索" + content)
				if (this.customNavTitleIndex == 2) {
					const loaction = uni.getStorageSync('address')
				} else {
					const loaction = uni.getStorageSync('address')
				}
			},


		}
	}
</script>

<style>
	.newCar-page {
		display: flex;
		flex-direction: column;
		width: 100%;
		height: auto;
	}

	.newCar-page .newCar-page__content {
		height: 100vh;
		/* 父元素设置相对定位 */
		position: relative;
		/* background-color: #F7F8FA; */
		background-color: #FFFFFF;
		padding: 26rpx 28rpx 0 28rpx;
	}

	/* 车系列表 */
	.carSeries-list {
		display: flex;
	}

	.carSeries-list__left {
		flex: 1;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.carSeries-list__right {
		flex: 1;
		display: flex;
		justify-content: center;
		align-items: center;

		margin-left: 14rpx;
	}

	/* 车系卡片 */
	.carSeries-card {
		border-radius: 10px;
		background-color: #FFFFFF;
		width: 100%;
		flex: 1;
		display: flex;
		flex-direction: row;
		align-items: center;
	}

	.carSeries-card__text {
		display: flex;
		flex-direction: column;
		margin-left: 30rpx;
	}

	.carSeries-card__text .title {
		font-family: Source Han Sans CN;
		font-weight: bold;
		font-size: 14px;
		text-align: left;
	}

	.carSeries-card__text .desc {
		margin-top: 5px;
		text-align: left;
		font: Alimama ShuHeiTi;
		font-size: 12px;
		color: #666666;
	}

	.carSeries-card__image {
		width: 58rpx;
		height: 50rpx;
		margin: 39rpx 50rpx 39rpx auto;
	}

	/* 常用车品牌列表 */
	.carCommonBrand-list {
		text-align: left;
		background-color: #FFFFFF;
		/* margin: 0px 14px 0px 14px; */
		border-radius: 10px;
		padding: 28rpx;
	}

	.carCommonBrand-list__title-background {
		width: 75px;
		background: url(@/static/bac-small.png);
		background-size: 100% 100%;
	}

	.carCommonBrand-list__title {
		width: 140rpx;
		font-size: 30rpx;
		font-weight: bold;
		color: #000026;
		opacity: 1;
		margin-left: 2rpx;
	}

	.carCommonBrand-list__content {
		display: flex;
		justify-content: center;
		padding: 37rpx 0 9rpx 0;
	}

	/* 车品牌 */
	.carBrand {
		flex: 1;
		width: 140rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.carBrand__image {
		height: 56rpx;
		width: 56rpx;
	}

	.carBrand__name {
		margin-top: 28rpx;

		font-size: 28rpx;
		font-weight: bold;
	}

	/* 车品牌索引列表 */
	.newCar-indexed-list__title-wrapper {
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		padding: 6px 0px 4px 14px;
	}

	.newCar-indexed-list__title {
		font-size: 28rpx;
		font-family: DIN Alternate;
		font-weight: bold;
		color: #1C2125;
		opacity: 1;
	}

	.newCar-indexed-list__menu {
		display: flex;
		position: fixed;

		top: 50%;
		right: 0;
		-webkit-transform: translate(-50%, -50%);
		transform: translate(0, -50%);

		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.nav-title {
		font-size: 36rpx;
		font-family: Source Han Sans CN;
		font-weight: 500;
		line-height: 0rpx;
		color: #FFFFFF;
		opacity: 1;
		margin-left: 20rpx;
		margin-right: 20rpx;
	}

	.nav-title-selected {
		font-family: Alimama ShuHeiTi;
		font-weight: bold;
	}

	.content-row {
		display: flex;
		flex-direction: row;
		align-items: center;
	}


	.pad18-14 {
		padding: 18rpx 28rpx;
	}

	.pad6-14-4 {
		padding: 6px 0px 4px 14px;
	}

	.iamge-class {
		width: 100rpx;
		height: 52rpx;
	}

	.marginLeft5 {
		margin-left: 5px;
	}

	.brand-name-class {
		font-size: 28rpx;
		font-family: Source Han Sans CN;
		font-weight: 400;
		color: #000026;
		opacity: 1;
	}

	.right-view-text {
		font-size: 20rpx;
		font-family: DIN Alternate;
		font-weight: bold;
		color: #999999;
		padding: 4rpx;
	}

	.right-view-text-select {
		font-size: 20rpx;
		font-family: DIN Alternate;
		font-weight: bold;
		color: #0E59EA;
		padding: 4rpx;
	}
</style>